


class ListNode{
    constructor(val, next=null){
      this.val = val 
      this.next = next 
    }
  }
  
  function toList(arr=[]){
    let hair = new ListNode(-1)
    let curNode = hair
    for (let i = 0;i < arr.length;i++){
      curNode.next = new ListNode(arr[i])
      curNode = curNode.next;
    }
    return hair.next
  }

  function toArray(node = new ListNode()){
      const arr =[]  ;
      while(node){
        arr.push(node.val)
        node = node.next
      }
      return arr
  }
let data
  while(data = readline() ){
      const [arr1, arr2] = JSON.parse(data);
      const node1 = toList(arr1)
      const node2 = toList(arr2)
  }
// 合并递增
  
function listMerge(node1, node2){
    const hair  = new ListNode(-1);
    let cur = hair ;
    while(node1 || node2){
        if ( node1 && (!node2 || node1.val < node2.val) ){
            cur.next = node1 ;
            node1 = node1.next ;
            cur = cur.next ;
        }else if(node2 && (!node1 || node1.val >= node2.val)){
            cur.next = node2
            node2 = node2.next
            cur = cur.next ;
        }
    }
}

export { ListNode}